//
//  DYJQYIngfuCell.swift
//  SheYangBigData
//
//  Created by 叁拾叁 on 2021/2/4.
//  Copyright © 2021 叁拾叁. All rights reserved.
//


import UIKit
import YYText

class DYJQYIngfuCell: SYBaseCell {

    var bgView: UIView = {
        let v: UIView = UIView()
        v.backgroundColor = .white
        v.layer.cornerRadius = 5
        v.layer.masksToBounds = true
        return v
    }()
    
    let jine: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x333333)
        v.font = 18.autoBoldFontSize()
        v.text  = "应付金额"
        return v
    }()
    
    let title: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x333333)
        v.font = 15.autoFontSize()
        
        v.text = "六合龙池湖门票成人票"
        return v
    }()
    
    let zhangshu: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x999999)
        v.font = 12.autoFontSize()
        v.text = "1*￥98"
        return v
    }()
    
    let riqiT: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x999999)
        v.font = 15.autoFontSize()
        v.text = "使用日期"
        return v
    }()
    
    let danjiaT: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x999999)
        v.font = 15.autoFontSize()
        v.text = "单价包含"
        return v
    }()
    
    let riqi: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x333333)
        v.font = 15.autoFontSize()
        v.text = "2021-01-18  周一"
        return v
    }()
    
    let danjia: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x333333)
        v.font = 15.autoFontSize()
        v.text = "【六合龙池湖门票成人票1张】"
        return v
    }()
    
    var price: YYLabel = {
        let v = YYLabel()
        v.textColor = UIColor(hex: 0x333333)
        v.font = 14.autoFontSize()
        return v
    }()

    
    
    func configure(_ model: RYDingdanModel) {
        
    }

    override func initViews() {
        price.attributedText = self.setPriceLb("55")
        self.backgroundColor = .clear
        addSubview(bgView)
        bgView.addSubview(jine)
        bgView.addSubview(price)
        bgView.addSubview(title)
        bgView.addSubview(zhangshu)
        bgView.addSubview(riqiT)
        bgView.addSubview(danjiaT)
        
        bgView.addSubview(riqi)
        bgView.addSubview(danjia)
        bgView.addSubview(lineView)
        
        jine.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(20.autoWidth())
            make.left.equalToSuperview().offset(10.autoWidth())
            make.height.equalTo(18.autoWidth())
        }
        price.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(22.autoWidth())
            make.right.equalToSuperview().offset(-14.autoWidth())
            make.height.equalTo(14.autoWidth())
        }
        lineView.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(58.autoWidth())
            make.left.equalToSuperview().offset(10.autoWidth())
            make.right.equalToSuperview().offset(-10.autoWidth())
            make.height.equalTo(0.5.autoWidth())
        }
        title.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(78.autoWidth())
            make.left.equalToSuperview().offset(10.autoWidth())
            make.height.equalTo(15.autoWidth())
        }
        zhangshu.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(78.autoWidth())
            make.right.equalToSuperview().offset(-13.autoWidth())
            make.height.equalTo(15.autoWidth())
        }
        riqiT.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(105.autoWidth())
            make.left.equalToSuperview().offset(10.autoWidth())
            make.height.equalTo(15.autoWidth())
        }
        danjiaT.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(135.autoWidth())
            make.left.equalToSuperview().offset(10.autoWidth())
            make.height.equalTo(15.autoWidth())
        }
        riqi.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(105.autoWidth())
            make.left.equalToSuperview().offset(95.autoWidth())
            make.height.equalTo(15.autoWidth())
        }
        danjia.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(135.autoWidth())
            make.left.equalToSuperview().offset(95.autoWidth())
            make.height.equalTo(15.autoWidth())
            make.bottom.equalToSuperview().offset(-17.autoWidth())
        }
        
        bgView.snp.makeConstraints { (make) in
            make.top.equalToSuperview()
            make.bottom.equalToSuperview().offset(-10.autoWidth())
            make.left.equalToSuperview()
            make.right.equalToSuperview()
        }
    }
}
